<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/a.css" id="link">
    <script src="js/docCookies.js"></script>
</head>
<body>
<ul>
    <li my-data="a.css">蓝色经典</li>
    <li my-data="b.css">银色酷炫</li>
    <li my-data="c.css">黑色</li>
</ul>
<script>
    var lis = document.getElementsByTagName('li');
    var link = document.getElementById('link');
    for(var i = 0,len=lis.length;i<len;i++){
        lis[i].onclick = function(){
            console.log(this.getAttribute('my-data'));
            var cssPath = this.getAttribute('my-data');
            link.href = 'css/'+cssPath;
            docCookies.setItem('cssPath',cssPath);
        }
    }

    if (docCookies.getItem('cssPath')){
        link.href = 'css/'+docCookies.getItem('cssPath');
    }
</script>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
<p>aa</p>
</body>
</html>